package com.hd.openapi.web.cotenollen;

import com.hd.openapi.common.ResponseResult;
import com.hd.openapi.common.ResultTable;
import com.hd.openapi.entity.Customer;
import com.hd.openapi.entity.Recharge;
import com.hd.openapi.servies.customerser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/customer")
public class customerconllen {
    @Autowired
    public customerser cts;
    @RequestMapping("/table")
    public ResultTable table(@RequestParam(defaultValue = "1") Integer page,
                             @RequestParam(defaultValue = "5") Integer limit,
                             String name,
                             String state){
        return cts.getdata(page,limit,name,state);
    }
    @RequestMapping("/add")
    public ResponseResult add(Customer customer){
        return cts.adddata(customer);
    }
    @RequestMapping("/update")
    public ResponseResult updata(Customer customer){
        return cts.updatadata(customer);
    }
    @RequestMapping("/del")
    public ResponseResult del(Integer[] ids){
        return cts.deldata(ids);
    }
}
